<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="css/pagination.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet"
	type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>商家周结打款处理</title>
<style>
.title {
	display: block;
	background: #5a98de;
	line-height: 31px;
	float: left;
	color: white;
	width: 95px;
	text-align: center;
}

.title:hover {
	text-decoration: none;
	color:black;
}
.rleft{
border-top-left-radius:5px;border-bottom-left-radius:5px;
}
.rright{
border-top-right-radius:5px;border-bottom-right-radius:5px;
}
.blue{
	background:#5a98de;
	color:white;
	border:1px solid #5a98de;
}
.def{
	background:white;
	color:black;
	border:1px solid black;
}
</style>
</head>
<body>
	<nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 商家周结处理
		<a class="btn btn-success btn-refresh radius r mr-20"
			style="line-height:1.6em;margin-top:3px" onclick="javascript:location.replace(location.href);"
			href="javascript:location.replace(location.href);" title="刷新">刷新</a>
	</nav>
	<div class="pd-20">
	
		<div class="cl pd-5 bg-1 bk-gray">
			<a id="one" name="-1" class="title rleft def">全部</a>
			<a id="two" name="1" class="title def">待处理</a>
			<a id="three" name="2" class="title rright def">已处理</a>
		</div>
		<div class="mt-20"></div>
	
		 <div class="cl pd-5 bg-1 bk-gray" style="margin-top:20px;">

			<form action="<%=path%>/backstage/shop-week-shipping" 
				class="form form-horizontal" id="search-form">
				<input type="hidden" name="payStatus" id="payStatus" value="${conditions.payStatus}">
				<div class="text-c">
				<div class="row cl">
					<label class="form-label col-1">所属站点：</label>
					<div class="formControls col-2">
					<span>
						<input type="text" name="cityName" value="${conditions.cityName}" placeholder="所属站点" class="input-text">
					</span>
					</div>
					
					<label class="form-label col-1">店铺名：</label>
					<div class="formControls col-2">
						<input type="text" value="${conditions.sname }" name="sname" id="c_sname" placeholder="店铺名" class="input-text">
					</div>
					
					<label class="form-label col-1">银行帐号：</label>
					<div class="formControls col-2">
						<input type="text" value="${conditions.bank_no }" name="bank_no" id="bank_no" placeholder="银行帐号" class="input-text">
					</div>
					
					<label class="form-label col-1">开户行：</label>
					<div class="formControls col-2">
						<input type="text" value="${conditions.bank_name}" name="bank_name" id="c_sname" placeholder="开户行" class="input-text">
					</div>
				</div>
				
				<div class="row cl">
					<label class="form-label col-1">商家上线时间：</label>
					<div class="formControls col-2">
						<input type="text"  name="c_appdate" readonly="readonly"  onfocus="WdatePicker({maxDate:'%y-%M-%d'})"  value="${conditions.c_appdate}"   class="input-text Wdate" >
					</div>
					
					<label class="form-label col-1">打款时间：</label>
					<div class="formControls col-2">
						<input type="text"  name="time" readonly="readonly"  onfocus="WdatePicker({maxDate:'%y-%M-%d'})"  value="${conditions.time}"   class="input-text Wdate" >
					</div>
					
				</div>
				
				<div class="row cl">
					<button name="" id="" class="btn btn-success" style="border-radius:5px;float:right;" type="submit">
						 查询
					</button>
					<div style="width:10px;height:5px;float:right;"></div>
					<button name="" onclick="theReset();" id="" class="btn btn-success" style="border-radius:5px;float:right;" >
						 重置
					</button>
				</div>
				</div>
			</form>

		</div>

		<div class="mt-20">
			<table
				class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
							<!-- <th width="80">序号</th> -->
                            <th width="80">商家名称</th>
                            <th width="80">所属站点</th>
                            <th width="80">开始日期</th>
                            <th width="80">结束日期</th>
                            <th width="80">商家银行账号</th>
                            <th width="80">开户行</th>
                            <th width="80">商家上线时间</th>
                            <th width="80">最新折扣比例</th>
                            <th width="80">订单总金额</th>
                            <th width="80">总配送费金额</th>
                            <th width="80">餐盒费总金额</th>
                            <th width="80">应打款金额</th>
                          	<th width="80">处理时间</th>
							<th width="80">状态</th>
							<th width="100">操作</th>
					</tr>
				</thead>
				<tbody>
						<c:forEach items="${stats}" var="stat">
						
						<tr class="text-c" id="${stat.stats_id}">
								<%-- <td>${transfer.stat_id}</td> --%>
                            	<td data-name="c_sname">${stat.sname}</td>
                            	<td data-name="cityName">${stat.cityName}</td>
                                <td>${stat.start_date}</td>
                                <td>${stat.end_date}</td>
                                <td data-name="bank_no">${stat.bank_no}</td>
                                <td data-name="bank_name">${stat.bank_name}</td>
                                <td>${stat.c_appdate}</td>
                                 <td>${stat.discount}</td>
                                <td>${stat.orders_money}</td>
                                <td>${stat.sendfee}</td>
                                <td>${stat.sum_lunchbox_price}</td>
                                <td>${stat.money}</td>
                                <td>${empty stat.pay_time ? '---' : stat.pay_time}</td>
                                <td>
                                	<c:choose>
                                		<c:when test="${stat.handle_status==0}">
                                			<span class="label label-warning  radius">待打款</span>
                                		</c:when>
                                		<c:when test="${stat.handle_status==1}">
                                			<span class="label label-success radius">已打款</span>
                                		</c:when>
									</c:choose>
                                </td>
							<td class="td-manage">
								<c:choose>
									<c:when test="${stat.handle_status==0}">
										<a class="label label-primary radius"
											onClick="pmoney_apply('${stat.stats_id}','${stat.money}')" href="javascript:void(0);"
											title="打款">打款</a>
									</c:when>
									
                                </c:choose>
                                  <a class="label label-primary radius"
								onClick="t_shipping_edit('${stat.shop_id}','${stat.start_date}','${stat.end_date}')" href="javascript:void(0);"
								title="详情">详情</a>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<div id="Pagination" class="page-con"></div>
			
			<input type="hidden" id="applyid">
			<input type="hidden" id="shopid">
			<input type="hidden" id="money">
			<input type="hidden" id="status">
		</div>
	</div>
	<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript"
		src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="js/H-ui.js"></script>
	<script type="text/javascript" src="js/jquery.pagination.js"></script>
	<script type="text/javascript" src="js/H-ui.admin.js"></script>
	<script type="text/javascript">
	$(function() {
		initPager();
	});
	
	var showCount = ${pageInfo.showCount};
	var currentPage = ${pageInfo.currentPage-1};
	var totalResult = ${pageInfo.totalResult};
	function initPager(){
		$("#Pagination").pagination(totalResult, {
            callback: function(new_page_index, pagination_container){
            	var oldLocation = location.href;
            	var pa = "currentPage=" + (new_page_index+1);
        		var shoC = "showCount=" + showCount;
            	var index = oldLocation.lastIndexOf("?");
            	if (index == -1){
            		location.href = oldLocation + "?" + pa + "&" + shoC;
            	}else if (oldLocation.indexOf("currentPage") == -1){
            		location.href = oldLocation + "&" + pa;
            	}else if (oldLocation.indexOf("showCount") == -1){
            		location.href = oldLocation + "&" + shoC;
            	}else{
            		var temp = oldLocation.replace(/currentPage=\d+/, pa);
					var newLocation = temp.replace(/showCount=\d+/, shoC);
            		location.href = newLocation;
            	}
            	return false;
            },
            items_per_page:showCount, 
            load_first_page:false,
            prev_text:'上一页',
            next_text:'下一页',
            ellipse_text:'...',
            num_edge_entries:1,
            num_display_entries:5,
            current_page:currentPage,
        });
	}
	
	/*
	重置
	*/
	function theReset(){
		$("#search-form input[type='text']").val('');
		$("#search-form select").val(-1);
		$("#payStatus").val('-1');
	}
		
		/*打款*/
		function pmoney_apply(stats_id,money){
			var edit_page = "<%=path%>/backstage/re-pay-week-money-to-shop?stats_id="+stats_id;
			layer_show("商家周结打款",edit_page);
		}
		
		/*详情*/
		function t_shipping_edit(shop_id,startTime,endTime){
			var edit_page = "<%=path%>/backstage/shop_shipper_week_order_list?startTime=" + startTime + "&endTime=" + endTime + "&shop_id=" + shop_id;
			layer_show("详情",edit_page);
		}

		
		$(".title").click(function(){
			$(".title").css({"background":"white","border":"1px solid black","color":"black"});
			$(this).css({"background":"#5a98de","border":"1px solid #5a98de"});
			$("#payStatus").val($(this).attr("name"));
			$("#search-form").submit();
		});
		
		if($("#payStatus").val()==-1){
			$(".title").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"#5a98de","border":"1px solid #5a98de"});
		}else if($("#payStatus").val()==1){
			$(".title").css({"background":"white","border":"1px solid black","color":"black"});
			$("#two").css({"background":"#5a98de","border":"1px solid #5a98de"});
		}else if($("#payStatus").val()==2){
			$(".title").css({"background":"white","border":"1px solid black","color":"black"});
			$("#three").css({"background":"#5a98de","border":"1px solid #5a98de"});
		}else {
			$(".title").css({"background":"white","border":"1px solid black","color":"black"});
			$("#one").css({"background":"#5a98de","border":"1px solid #5a98de"});
		}

	</script>
</body>
</html>



